package cn.wolfcode.ssm.web.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import cn.wolfcode.ssm.service.IDepartmentService;

/**
 * 部门表现层： 
 * 用于接受请求， 处理请求， 响应请求
 * @author Administrator
 *
 */
@Controller
@RequestMapping("/department")
public class DepartmentController {

	
	@Autowired
	private IDepartmentService departmentService;
	
	//部门列表
	@RequestMapping("/list")
	public String list(Model model) {
		//model 可以将controlller数据共享到页面上进行列表
		//将部门列表数据共享的页面
		model.addAttribute("list", departmentService.list());
		
		//处理请求完之后， 跳转的页面， 通过视图解析器拼接而成
		///WEB-INF/views/department/list.jsp
		return "department/list";
	}
	
	
}
